home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in</name>
- <id>-1</id>
- <cardCount>2</cardCount>
- <cardID>3290</cardID>
- <listID>2134</listID>
- <cantModify><false /></cantModify>
- <cantDelete><false /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>342</height>
- </cardSize>
- <script>---------------------- Open StackΓäó Copyright 1987-----------------------
- ---------------------- by the Walking Shadow Press ---------------------
- on startUp
- getHomeInfo
- global fieldScript,fieldList,bookNumber,autoNumbering
- global tentativeBook, initGlobals
- ------------------------------------------------------------------
- -- fieldScript is a global which contains the script that is --
- -- automatically loaded into each newly created field. --
- -- The field must be named at the time of creation in order --
- -- for fieldScript to be loaded into its script. Otherwise, --
- -- errors result. --
- -- --
- -- --
- -- The following put commands put the generic field script --
- -- into global fieldScript. --
- ------------------------------------------------------------------
- put empty into fieldScript
- put "on closeField" into line 1 of fieldScript
- put "global fieldList" into line 2 of fieldScript
- put "put word 3 of name of me into tempName" into line 3 of ¬
- fieldScript
- put "if not(fieldList contains tempName) then" into line 4 of ¬
- fieldScript
- put "put (word 3 of name of me) & ""e&",""e&" after fieldList" ¬
- into line 5 of fieldScript
- put "end if" into line 6 of fieldScript
- put "end closeField" into line 7 of fieldScript
-
- ---------------------------------------------------------------------
- -- fieldList is the global whick keeps track of which fields are --
- -- altered and need to be replicated each time a card is opened --
- -- and then closed. --
- ---------------------------------------------------------------------
- put empty into fieldList
- ---------------------------------------------------------------------
- -- tentativeBook is a global which records whether a new card is --
- -- being tentatively numbered, awaiting the entry of book data. --
- ---------------------------------------------------------------------
- put false into tentativeBook
-
- --------------------------------------------------------------------
- -- The automatic book numbering feature uses the globals: --
- -- autoNumbering and bookNumber to record whether autonumbering --
- -- is currently turned on and the next book number, respectively. --
- -- They must be initialized on startUp by going to the control --
- -- card and accessing the "Book Number" field and the --
- -- autoNumbering button. --
- --------------------------------------------------------------------
- set lockScreen to true
- push card
- put true into initGlobals
- go to stack "Control"
- put the hilite of button "Auto Numbering" into autoNumbering
- put card field "Book Number" into bookNumber
- ----------------------------------------------------------------
- -- initGlobals records whether the globals have already been --
- -- initialized or not. Otherwise, upon entry to the control --
- -- card, the "Book Number" field would be set to the current --
- -- value of global bookNumber, which is at first empty. --
- ----------------------------------------------------------------
- put false into initGlobals
- pop card
- set lockScreen to false
-
- pass startUp
- end startUp
-
- on openStack
- global beginGlobal
- -----------------------------------------------------------------
- -- This stack might be opened directly, which means that the --
- -- globals may not be initialized yet. beginGlobal will --
- -- always be false if the library system is up already. --
- -- Otherwise, a startUp message is send to initialize the --
- -- globals. --
- -----------------------------------------------------------------
- if beginGlobal is not false then
- put false into beginGlobal
- set cursor to 4
- startUp
- end if
- end openStack
-
- on quit
- global bookNumber
- -----------------------------------------------------------
- -- on quit we should save the bookNumber global so its --
- -- current value will be available upon startUp later. --
- -- bookNumber is saved in the "Book Number" field on the --
- -- conrtol card. --
- -----------------------------------------------------------
- set lockScreen to true
- push card
- go to stack "Control"
- put bookNumber into card field "Book Number"
- pop card
- set lockScreen to false
- end quit
-
- on mkNewCard
- global autoNumbering
- ---------------------------------------------------------------------
- -- This handler coordinates the creation of a new card set --
- -- record. It does so by going to each of the four main stacks: --
- -- Acquisition, Circulation, Catalog, and Label Setup and --
- -- making a new card on each. --
- -- At the same time the cards are made, their id numbers are --
- -- noted and from all four id numbers is created the card script --
- -- which controls the transfer to the related cards of each stack.--
- ---------------------------------------------------------------------
- set cursor to 4
- -- First, we create a new card in the current stack. --
- doMenu "New Card"
- set lockScreen to true
-
- -- We record the id of the newly created card in circId. --
- put the id of this card into circId
-
- -------------------------------------------------------------------
- -- Next, we create a segment of what will eventually be the --
- -- card script of each new card. The following segment will --
- -- handle transfers from other stacks to the card just created. --
- -------------------------------------------------------------------
- put "on goCirc" into line 1 of goCircScr
- put "go to "&circId&" of stack Circulation" into line 2 of goCircScr
- put "end goCirc" into line 3 of goCircScr
- ---------------------------------------------------------------------
- -- We push this card, 'cause we'll be coming back. See the second --
- -- to the last comment in this handler. --
- ---------------------------------------------------------------------
- push card
- ---------------------------------------------------------------------
- -- We next go to the Acquisition stack and do the same operations --
- -- as above, then go to the Catalog stack, and then the Label --
- -- Setup stack below... --
- ---------------------------------------------------------------------
- go to stack "Acquisitions"
- doMenu "New Card"
-
- put the id of this card into acqId
-
- put "on goAcq" into line 1 of goAcqScr
- put "go to "&acqId&" of stack Acquisitions" into line 2 of goAcqScr
- put "end goAcq" into line 3 of goAcqScr
- push card
- ------------------------------------------------------------------
- go to stack "Cataloging" -- See last comment.
- doMenu "New Card"
-
- put the id of this card into catId
-
- put "on goCat" into line 1 of goCatScr
- put "go to "&catId&" of stack Cataloging" into line 2 of goCatScr
- put "end goCat" into line 3 of goCatScr
- push card
- ------------------------------------------------------------------
- go to stack "Labels" -- See last big comment.
- doMenu "New Card"
-
- put the id of this card into labId
-
- put "on goLab" into line 1 of goLabScr
- put "go to "&labId&" of stack Labels" into line 2 of goLabScr
- put "end goLab" into line 3 of goLabScr
- ------------------------------------------------------------------
- -- Now, from all the card script segments created above, we --
- -- synthesize a big card script that will handle inter-stack --
- -- transfers. We combine all the segments into the variable --
- -- cardScr. --
- ------------------------------------------------------------------
- put goAcqScr into cardScr
- put goCircScr into line 4 of cardScr
- put goCatScr into line 7 of cardScr
- put goLabScr into line 10 of cardScr
-
- -------------------------------------------------------------------
- -- Finally, since we've been "pushing" cards as we went along, --
- -- all we do now is retrace our card steps by "popping" and --
- -- set the card scripts of each card we created to the --
- -- synthesized script. --
- -------------------------------------------------------------------
- set the script of this card to cardScr
- pop card
- set the script of this card to cardScr
- pop card
- set the script of this card to cardScr
- pop card
- set the script of this card to cardScr
-
- --------------------------------------------------------------------
- -- Look at the openCard handler in the background script. You --
- -- will notice that the auto-numbering function is deactivated --
- -- if the card's script is emtpy. This is done to prevent --
- -- autonumbering while the cards are created. --
- -- Now, however, we want the auto-numbering function to work, --
- -- provided it's been turned on, so we send an openCard --
- -- message to the current card. --
- --------------------------------------------------------------------
- if autoNumbering is true then send openCard to this card
-
- set lockscreen to false
- end mkNewCard
-
- on delCard
- ---------------------------------------------------------------------
- -- This handler coordinates the deletion of card sets --
- -- It does so by going to each of the four main stacks: --
- -- Acquisition, Circulation, Catalog, and Label Setup and --
- -- deleting the right card in each. --
- -- To make sure the right card is deleted, we use the --
- -- go to command that appears in the card script, which is the --
- -- same command that normally transfers to other cards from --
- -- the current one. --
- ---------------------------------------------------------------------
- if the number of cards >1 then
- answer "Delete this and related cards in other stacks?" with ¬
- "OK" or "Cancel"
- if it is not "Cancel" then
- set cursor to 4
- set lockScreen to true
-
- push card
- do line 2 of the script of this card -- go to Acquisition
- --------------------------------------------------------------
- -- Unfortunately, we cannot delete immediately, else --
- -- we lose our way to the other cards, so push this card... --
- --------------------------------------------------------------
- push card
- do line 8 of the script of this card -- go to Catalog
- push card -- Push the catalog card too.
- do line 11 of the script of this card -- go to Label SetUp
- --------------------------------------------------------------
- -- Now that we have all the related cards nicely lined --
- -- up in the card id stack, we just delete and pop, delete --
- -- and pop ... etc. --
- --------------------------------------------------------------
- doMenu "Delete Card"
- pop card
- doMenu "Delete Card"
- pop card
- doMenu "Delete Card"
- pop card
- doMenu "Delete Card"
-
- set lockscreen to false
- end if
- else
- answer "The last card cannot be deleted."
- end if
- end delCard
-
- on arrowKey whichKey
- --------------------------------------------------------------
- -- If the keyboard has arrow, we make use of some to go to --
- -- next and previous cards... --
- --------------------------------------------------------------
- if the CommandKey is down then
- mkNewCard
- else
- if whichKey = "right" then
- go to next card
- else
- if whichKey = "left" then
- go to prev card
- end if
- end if
- end if
- end arrowKey
-
- -------------------- End Walking Shadow Library ---------------------
-
- on resume
- getHomeInfo
- pass resume
- end resume
-
- on getHomeInfo
- global stacks,applications,documents,userName
- set lockScreen to true
- set lockMessages to true
- push this card
- go to card "User Preferences"